package com.wxp.demo08.page;

import android.os.Bundle;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.ViewPager;

import com.wxp.demo08.R;
import com.wxp.demo08.page.adapter.LaunchSimpleAdapter;

/**
 * 3.3 简单的启动引导页
 */
public class LaunchSimpleActivity extends AppCompatActivity {

    /**
     * 声明引导页面的图片数组
     */
    private final int[] launchImageArray = {R.drawable.guide_bg1,
            R.drawable.guide_bg2,
            R.drawable.guide_bg3,
            R.drawable.guide_bg4};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_launch_simple);

        this.setTitle("3.3 简单的启动引导页");

        ViewPager vp_launch = findViewById(R.id.vp_launch);
        //创建适配器
        LaunchSimpleAdapter adapter = new LaunchSimpleAdapter(this, launchImageArray);
        vp_launch.setAdapter(adapter);
    }
}